xen/arm: introduce put_page_nr and get_page_nr
authorPenny Zheng <Penny.Zheng@arm.com>
Thu, 8 Sep 2022 13:55:08 +0000 (21:55 +0800)
committerStefano Stabellini <stefano.stabellini@amd.com>
Fri, 9 Sep 2022 19:57:59 +0000 (12:57 -0700)
commit5951b856d8d0af57212b54f2afbb404b7579bd27
tree1c0cf9f3d969a9e5cae891cb5ee18eef471d8780
parent83d55ba81783f9fd4f2a4c37e11bd6e89f858a36
xen/arm: introduce put_page_nr and get_page_nr

Later, we need to add the right amount of references, which should be
the number of borrower domains, to the owner domain. Since we only have
get_page() to increment the page reference by 1, a loop is needed per
page, which is inefficient and time-consuming.

To save the loop time, this commit introduces a set of new helpers
put_page_nr() and get_page_nr() to increment/drop the page reference by nr.

Signed-off-by: Penny Zheng <penny.zheng@arm.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Reviewed-by: Julien Grall <jgrall@amazon.com>
xen/arch/arm/include/asm/mm.h
xen/arch/arm/mm.c